<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQaecmsUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('qaecms_users', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('用户ID');
            $table->string('name')->unique('name')->comment('用户名称');
            $table->string('nick')->comment('用户昵称');
            $table->string('password')->comment('用户密码');
            $table->string('email')->unique()->comment('用户邮箱');
            $table->ipAddress('registerip')->comment('注册时IP')->nullable();
            $table->tinyInteger('vip')->comment('用户等级 0注册用户 1VIP用户')->default(0);
            $table->biginteger('integral')->comment('用户积分余额')->default(0);
            $table->longText('avatar')->comment('用户头像')->nullable();
            $table->dateTime('logintime')->comment('用户登陆时间')->nullable();
            $table->ipAddress('loginip')->comment('用户登录IP')->nullable();
            $table->dateTime('lastlogintime')->comment('用户上次登录时间')->nullable();
            $table->ipAddress('lastloginip')->comment('用户上次登录IP')->nullable();
            $table->tinyInteger('status')->comment('状态 0不可用 1可用')->default(1);
            $table->dateTime('vip_endtime')->comment('vip到期时间')->nullable();
            $table->timestamp('email_verified_at')->comment('邮箱验证时间')->nullable();
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('qaecms_users');
    }
}
